﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using FB.Extensions;


namespace FB.Helpers
{
    public abstract class AppSettingsBase  
    {
        static string _APPKEY = "AppKey";


        public static string AppKey {
            get { return ConfigurationManager.AppSettings[_APPKEY]; }
        }

        public static string RiskApproveUser {
            get { return ConfigurationManager.AppSettings["RiskApproveUser"]; }
        }

        public static string LegalApproveUser {
            get { return ConfigurationManager.AppSettings["LegalApproveUser"]; }
        }

        public static string RiskDirApproveUser {
            get { return ConfigurationManager.AppSettings["RiskDirApproveUser"]; }
        }

        public static string GuaranteeApproveUser {
            get { return ConfigurationManager.AppSettings["GuaranteeApproveUser"]; }
        }

        public static string GeneralMgrApproveUser {
            get { return ConfigurationManager.AppSettings["GeneralMgrApproveUser"]; }
        }

        public static string BossApproveUser {
            get { return ConfigurationManager.AppSettings["BossApproveUser"]; }
        }


        // will be remove later
        public static string EmployeeServiceEndPointAddr
        {
            get { return ConfigurationManager.AppSettings["EmployeeServiceEndPointAddr"]; }
        }

        public static string DefaultDateFormat {
            get { return ConfigurationManager.AppSettings["DefaultDateFormat"].GetValueOrDefault("yyyy/MM/dd"); } 
        }

        public static string DefaultDateTimeFormat {
            get { return ConfigurationManager.AppSettings["DefaultDateTimeFormat"].GetValueOrDefault("yyyy/MM/dd HH:mm:ss"); } 
        }

        public static string ISODateTimeFormat {
            get { return ConfigurationManager.AppSettings["ISODateTimeFormat"].GetValueOrDefault("yyyy-MM-ddTHH:mm:ss.fff"); } 
        }

        

        public static string SystemAdmin
        {
            get { return ConfigurationManager.AppSettings["SysadminUsername"].GetValueOrDefault("sysadmin"); }
        }

        public static void SetAppKey(string Key)
        {
            ConfigurationManager.AppSettings[_APPKEY] = Key;
        }


        public static string DefaultUserPwd
        {
            get { return ConfigurationManager.AppSettings["DefaultUserPwd"].GetValueOrDefault("abc123"); }
        }

        public static bool IsDataEncryptionEnabled
        {
            get { return Convert.ToBoolean(ConfigurationManager.AppSettings["EncryptionEnabled"].GetValueOrDefault("false")); }
        }

        public static string EncryptionHashKey
        {
            get { return ConfigurationManager.AppSettings["EncryptionHashKey"].GetValueOrDefault(""); }
        }

        

    }
}